<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
</head>
<body>
<script type="text/javascript">
    function showJSON() {

        var obj = {
            "age-name" : [1, 2, 4]
        };

        var user = {
                "user-name": "andy",
                "age": "20",
                "info": { "tel": "123456", "cellphone": "98765"},
                "address":
                    [
                        {"city":"beijing","postcode":"222333"},
                        {"city":"newyork","postcode":"555666"}
                    ]
            }
        alert(user.username);
        alert(user.age);
        alert(user.info.cellphone);
        alert(user.address[0].city);
        alert(user.address[0].postcode);
    }

    showJSON();

</script>
</body>
</html>